/*
    This program downloading and printing quotes from Forismatic.com
    Copyright (C) <2012>  <Tielhalter>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    If you want help me with code, please write to <madwo@ovi.com>.
*/

#ifndef WIDGET_H
#define WIDGET_H

#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkAccessManager>
#include <QWidget>
#include <QTimer>

namespace Ui {
    class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    QNetworkAccessManager manager;
    QNetworkReply *reply;
    QUrl apiUrl;
    QByteArray requestString;
    QString answer;

    void start();

private slots:
    void on_pushButton_2_clicked();
    void on_pushButton_clicked();
    void getReplyFinished();
    void readyReadReply();

private:
    Ui::Widget *ui;
};

#endif // WIDGET_H
